﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Drawing;

namespace MipsPipelineSimulator
{
    class IDStage
    {
        //能否运行
        static public int enableRun = 0;

        static private ManualResetEvent manuaEevent = new ManualResetEvent(false);

        static private Thread idThread = null;

        static public Point[] position = new Point[42];

        static private MainForm mainForm = null;

        static private void ThreadFun()
        {

        }

        static public void Start(MainForm param)
        {
            mainForm = param;
            //开始标志
            manuaEevent = new ManualResetEvent(false);
            idThread = new Thread(new ThreadStart(ThreadFun));
            idThread.Start();
            idThread.Join();
            manuaEevent.Set();
            //结束标志
        }

        static public void Wait()
        {
            manuaEevent.WaitOne();
        }

        static public void Close()
        {
            if (idThread != null && idThread.IsAlive)
            {
                idThread.Abort();
            }
        }
    }
}
